<?php

require_once( $_SERVER['DOCUMENT_ROOT'].'/libs/smarty.inc' );

require_once( $_SERVER['DOCUMENT_ROOT'].'/libs/smt_variables.php' );

require_once( $_SERVER['DOCUMENT_ROOT'].'/libs/Class_DB.php' );

require_once( $_SERVER['DOCUMENT_ROOT'].'/libs/Class_ERROR.php' );

require_once( $_SERVER['DOCUMENT_ROOT'].'/libs/login.inc.php' );



if( !in_array( "M", $_SESSION['ADMIN_LOGIN']['AUTH_CD'] ) ) exit;


if( $_SERVER['REQUEST_METHOD'] == 'GET' ){

	if( isset($_GET['price_no']) && $_GET['price_no'] != '' ){		

		if( is_numeric( $_GET['price_no'] ) ){
			$db = new Class_DB;
			//SQLクエリー
			$sql = "SELECT * FROM p_consumer_detail where price_no = '".$_GET['price_no']."'";	
				
			$res = $db->query($sql);
	
					
			while( $row = mysql_fetch_array($res,MYSQL_ASSOC) ){				
				//1生産、②承認申請、3は承認、4承認が却下;5カスタマーOK]を、6顧客のNG
				if($row['status'] == 1){
					$opt = "<input type=\"text\"  name=\"status\" value=\"生産\" readonly />"	;	
				}elseif ($row['status'] == 2){
					$opt = "<input type=\"text\"  name=\"status\" value=\"承認申請\" readonly />"	;
				}elseif ($row['status'] == 3){
					$opt = "<input type=\"text\"  name=\"status\" value=\"は承認\" readonly />"	;
				}elseif ($row['status'] == 4){
					$opt = "<input type=\"text\"  name=\"status\" value=\"承認が却下\" readonly />"	;
				}elseif ($row['status'] == 5){
					$opt = "<input type=\"text\"  name=\"status\" value=\"カスタマーOK]を\" readonly />"	;
				}elseif ($row['status'] == 5){
					$opt = "<input type=\"text\"  name=\"status\" value=\"顧客のNG\" readonly />"	;
				}
				
				$row['opt'] = $opt;
				
				$pricelist[] = $row;				
					
			}
		}
	}
}



$menu_html = file_get_contents( $_SERVER['DOCUMENT_ROOT'].'/templates/web-admin/menu.html' );

$smarty->assign('menu_html', $menu_html);

$smarty->assign('pricelist', $pricelist);

$smarty->display('web-admin/price_form.html');


?>